<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>设备列表</title><!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <style>
    </style>
</head>
<div id="app">
    <el-table
            :data="tableData"
            border
            style="width: 100%">
        <el-table-column
                prop="id"
                label="Id"
                width="90">
        </el-table-column>
        <el-table-column
                prop="name"
                label="设备名称"
                width="180">
        </el-table-column>
        <el-table-column
                prop="name"
                label="操作"
                >
            <template #default="v">
                <el-button @click="play(v.row)">查看</el-button>
            </template>
        </el-table-column>
    </el-table>
</div>
<body>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!-- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="/static/uikit/code/ezuikit.js"></script>
<script src="/static/uikit/code/js/jquery.min.js"></script>

<script>
    new Vue({
        el: '#app',
        data: function() {
            return {
                visible: false,
                tableData: JSON.parse('{$devices|raw}')
            }
        },
        methods: {
            play(row){
                window.open('/admin/user/play?serial=' + row.serial)
            }
        }
    })
</script>
</body>
</html>